package com.fandy.struts.DAL;

import java.sql.ResultSet;
import java.sql.SQLException;

import com.fandy.struts.SqlAccess.SqlServerHelper;
import com.fandy.struts.SqlStatement.Department;


public class DALDepartment {
 
	Department d = new Department();
	SqlServerHelper ssh = new SqlServerHelper();
	
	public   ResultSet  getAll()
	{
		return   ssh.executeScalar(d.getAll());
	}
	
	public   ResultSet getDeptInfoByID(int ID)
	{
		return  ssh.executeScalar(d.getDepInfoByID(ID));
	}
	
	
	public   ResultSet  existDepartment(com.fandy.struts.Model.Department d)
	{
		return  ssh.executeScalar(this.d.existDepartment(d));
	}
	
	public int UpdateByID(int id,com.fandy.struts.Model.Department d) throws SQLException
	{
		
		return ssh.executeNoQuery(this.d.UpdateByID(id,d));  
	}
	
	public int DeleteByID(int id) throws SQLException
	{		
		return ssh.executeNoQuery(d.DeleteByID(id));
		
	}
	
	
	
}

